﻿@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>Insert</title>
    <script src="/Source/assets/js/jquery.min.js"></script>
    <script src="/Source/assets/js/amazeui.min.js"></script>
    <script src="/Source/assets/js/app.js"></script>

    <link rel="apple-touch-icon-precomposed" href="/Source/assets/i/app-icon72x72@2x.png">
    <meta name="apple-mobile-web-app-title" content="Amaze UI">
    <link rel="stylesheet" href="/Source/assets/css/amazeui.min.css">
    <link rel="stylesheet" href="/Source/assets/css/admin.css">
    <script src="~/Source/layui/layui.all.js"></script>
    <script src="~/Source/layui/layui.js"></script>
    <link href="~/Source/layui/css/layui.css" rel="stylesheet" />
    
    <link href="/Source/bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen">
    <link href="/Source/css/bootstrap-datetimepicker.min.css" rel="stylesheet" media="screen">
    <script type="text/javascript" src="/Source/jquery/jquery-1.8.3.min.js" charset="UTF-8"></script>
    <script type="text/javascript" src="/Source/bootstrap/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="/Source/js/bootstrap-datetimepicker.js" charset="UTF-8"></script>
    <script type="text/javascript" src="/Source/js/locales/bootstrap-datetimepicker.fr.js" charset="UTF-8"></script>
    <script type="text/javascript">
        $(function() {
            $('.form_datetime').datetimepicker({
                //language:  'fr',
                weekStart: 1,
                todayBtn: 1,
                autoclose: 1,
                todayHighlight: 1,
                startView: 2,
                forceParse: 0,
                showMeridian: 1
            });
            $('.form_date').datetimepicker({
                language: 'fr',
                weekStart: 1,
                todayBtn: 1,
                autoclose: 1,
                todayHighlight: 1,
                startView: 2,
                minView: 2,
                forceParse: 0
            });
            $('.form_time').datetimepicker({
                language: 'fr',
                weekStart: 1,
                todayBtn: 1,
                autoclose: 1,
                todayHighlight: 1,
                startView: 1,
                minView: 0,
                maxView: 1,
                forceParse: 0
            });
        })
</script>

    <script>
        $(function() {
            $("#btnOK").click(function () {
                ISubmit();
                $.post("/Punch/InsertPunch", $("#punchFrm").serialize(), function (returnData) {
                    if (returnData) {
                        layer.alert("操作成功！！！");
                        
                    } else {
                        layer.alert("操作失败！！！");
                    }
                })
            });
        })
        function ISubmit() {
            var time1 = $("#dtp_input3").val();
            var time2 = $("#dtp_input4").val();
            if (time1 == "") {
                layer.tips($("#time1"), 3000, { icon: 1 });
                return false;
            }
            if (time2 == "") {
                layer.tips($("#time2"), 3000, { icon: 1 });
                return false;
            }
            return true;
        }
    </script>
</head>
<body>
    <form  method="post" id="punchFrm"  >
        <div class="am-tab-panel am-fade am-active am-in" id="tab1">
            <div class="am-g am-margin-top">
                <div class="am-u-sm-2 am-text-right">类型</div>
                <div class="am-u-sm-10">
                    <select name="type">

                        <option value="0">上半年</option>
                        <option value="1">下半年</option>
                        <option value="-1">全年</option>
                    </select>
                </div>
            </div>

            <div class="am-g am-margin-top">
                <div class="am-u-sm-2 am-text-right" style="width: 100px;">
                    上班时间
                </div>
                <div class="am-u-sm-4">
                    <div class="control-group">
                        @*<label class="control-label">Time Picking</label>*@
                        <div class="controls input-append date form_time" data-date="" data-date-format="hh:ii" data-link-field="dtp_input3" data-link-format="hh:ii">
                            <input size="16" type="text" value="" readonly=""  id="time1">
                            <span class="add-on"><i class="icon-remove"></i></span>
                            <span class="add-on"><i class="icon-th"></i></span>
                        </div>
                        <input type="hidden"  value="" id="dtp_input3" name="time1" /><br />
                    </div>
                </div>
                <div class="am-u-sm-6"></div>
            </div>
            <div class="am-g am-margin-top">
                <div class="am-u-sm-2 am-text-right" style="width: 100px;">
                    下班时间
                </div>
                <div class="am-u-sm-4">
                    <div class="control-group">
                        @*<label class="control-label">Time Picking</label>*@
                        <div class="controls input-append date form_time" data-date="" data-date-format="hh:ii" data-link-field="dtp_input4" data-link-format="hh:ii">
                            <input size="16" type="text" value="" readonly="" id="time2">
                            <span class="add-on"><i class="icon-remove"></i></span>
                            <span class="add-on"><i class="icon-th"></i></span>
                        </div>
                     <input type="hidden"  value="" id="dtp_input4" name="time2"   /><br />
                    </div>
                </div>
                <div class="am-u-sm-6"></div>
            </div>
            <br />
            <button type="button" class="am-btn am-btn-primary am-btn-xs" id="btnOK" style="margin-left: 150px;">提交保存</button>

        </div>
    </form>
</body>
</html>
